package com.jjy.tools.dto;

import com.jjy.pojo.User;
import com.jjy.tools.encrypt.SHAencrypt;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;

public class LoginDto {

  public static User getUserFromLogin(HttpServletRequest request, Model model) throws Exception {
    User user = new User();
    String encryptPassword = SHAencrypt.encryptString(request.getParameter("password"));
    user.setAccount(request.getParameter("account"));
    user.setPassword(encryptPassword);
    return user;
  }
}
